<template>
        <h4>busA组件</h4>
        <button @click="emitB">emit</button>
</template>
    
<script setup lang='ts'>
// 使用自定义bus
// import Bus from '../utils/bus'
//     let emitB = function() {
//         Bus.$emit('my-fn', 123);
//     }

import { getCurrentInstance } from "@vue/runtime-core";

// 使用mitt库bus
const instance = getCurrentInstance();
    let emitB = function() {
        instance.proxy.$Bus.emit('my-fn', 999);
        instance.proxy.$Bus.emit('my-fn2', 666);
    };
</script>
    
<style>
    
</style>